<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 750rem 10rem
            屏幕不管多宽 10rem
            1rem html.fonSize
        */
        div{
            /* alt+z 实现px--rem转换 */
            width: 10rem; /* 750px--10rem  */
        }
    </style>
</head>
<body>
    <div>

    </div>
    rem
    <script>
        var vw = window.innerWidth;
        var rem = vw/10;
        console.log(rem);
        var root = document.getElementsByTagName('html')[0]
        root.style.fontSize = rem+'px';
        window.onresize = function(){
            var vw = window.innerWidth;
            root.style.fontSize = vw/10+'px'
        }
    </script>
</body>
</html>